function search_func(user,seller){
    var data ={
        user:user,
        seller:seller,
    }
    $.ajax({
        type: 'GET',
        url: "/conversation/search", 
        data: data,  
        ContentType: 'application/json;charset=utf-8',
        success: function(data) { 
            
        },
        error: function(xhr, type) {
            console.log("Error");
        }
    });
}

function addcon_func(user,seller){
    var data ={
        user:user,
        seller:seller,
    }
    $.ajax({
        type: 'GET',
        url: "/conversation/add", 
        data: data,  
        ContentType: 'application/json;charset=utf-8',
        success: function(data) { 
            
        },
        error: function(xhr, type) {
            console.log("Error");
        }
    });
}

function getall_func(user){
    var data ={
        user:user,
    }
    $.ajax({
        type: 'GET',
        url: "/conversation/getall/user", 
        data: data,  
        ContentType: 'application/json;charset=utf-8',
        success: function(data) { 
            
        },
        error: function(xhr, type) {
            console.log("Error");
        }
    });
}

function getall2_func(seller){
    var data ={
        seller:seller,
    }
    $.ajax({
        type: 'GET',
        url: "/conversation/getall/seller", 
        data: data,  
        ContentType: 'application/json;charset=utf-8',
        success: function(data) { 
            
        },
        error: function(xhr, type) {
            console.log("Error");
        }
    });
}

function history_search_func(from,to){
    var data ={
        from:from,
        to:to,
    }
    $.ajax({
        type: 'GET',
        url: "/history/search", 
        data: data,  
        ContentType: 'application/json;charset=utf-8',
        success: function(data) { 
            
        },
        error: function(xhr, type) {
            console.log("Error");
        }
    });
}

function history_add_func(from,to,text){
    var data ={
        from:from,
        to:to,
        text:text,
    }
    $.ajax({
        type: 'GET',
        url: "/history/add", 
        data: data,  
        ContentType: 'application/json;charset=utf-8',
        success: function(data) { 
            
        },
        error: function(xhr, type) {
            console.log("Error");
        }
    });
}

